package com.axt.dbaudit.unitTest;

import java.util.List;

import com.axt.dbaudit.bean.cfg.MonitorBean;
import com.axt.dbaudit.model.cfg.Monitor;

public class SoaMonitorTest {
	void test() {
		memAndCpuTest();
		diskTest();
	}

	void memAndCpuTest() {
		Monitor monitor = new MonitorBean().queryMemAndCPU();
		if (monitor != null) {
			System.out.println(monitor.getMemory_free());

		} else {
			System.out.println("获得内存信息与cpu信息失败");
		}
	}

	void diskTest() {
		List<Monitor> oWelcomes = new MonitorBean().queryHDDInfo();
		if (oWelcomes != null) {
			for (int i = 0; i < oWelcomes.size(); i++) {
				System.out.println(oWelcomes.get(i).getDisk_type());
			}
		} else {
			System.out.println("获得硬盘信息失败");
		}
	}

	public static void main(String[] args) throws Exception {
		new SoaMonitorTest().test();
	}
}
